package com.hzmall.dao;

import com.hzmall.pojo.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    User login(@Param("username") String username,@Param("password") String password);

    Integer checkUsername(String username);

    Integer checkUserEmail(String email);

    String getForgetQuestion(String username);

    Integer checkAnswer(@Param("username") String username,@Param("question")String question,@Param("answer") String answer);

    Integer resetPassword(@Param("username") String username,@Param("password") String password);

    User selectUserByUsernameAndPassword(@Param("username")String username,@Param("password")String password);

    User selectAdminUser(@Param("username")String username,@Param("password")String password,@Param("role") Integer role);

    List<User> selectAllUser();

    Integer countUser();
}